%%% 计算对应的角向函数
function TM = angular(j_max,lent,theta)
TM = zeros(j_max-1,lent);
for j = 2:j_max
    %---计算j对应的阶数n和角向频率m---
    [n,m] = Noll_j_to_nm(j);
    
    if m==0
        TM(j-1,:)=sqrt(n+1);
    end
    if m~=0 && rem(j,2)==0
        TM(j-1,:)=sqrt(2*n+2)*cos(theta*m);
    end
    if m~=0 && rem(j,2)==1
        TM(j-1,:)=sqrt(2*n+2)*sin(theta*m);
    end
end

% end of function
end